# -*- coding:utf-8 -*-

from com.mat.rpa.utils.globalConstants import GlobalConstants
from com.mat.rpa.views.workWindow.leftPanel.directiveTree import treeItem
from . import fileOperationConstants

class FileOperationSubDirectiveTree(treeItem.TreeItemWithID):
    def __init__(self, parent):
        super(FileOperationSubDirectiveTree, self).__init__(parent)
        self.createFileOperationTreeNode()

    def createFileOperationTreeNode(self):
        self.nodeType = GlobalConstants.treeBranchType
        self.directiveType = "fileOperations"
        self.setText(0,"文件操作")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, fileOperationConstants.FileOperationConstants.gettingFileListDirective, "获取文件列表")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, fileOperationConstants.FileOperationConstants.copyingFileDirective, "拷贝文件")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, fileOperationConstants.FileOperationConstants.movingFileDirective, "移动文件")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, fileOperationConstants.FileOperationConstants.renamingFileDirective, "文件重命名")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, fileOperationConstants.FileOperationConstants.deletingFileDirective, "删除文件")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, fileOperationConstants.FileOperationConstants.readingFileDirective, "读取文件")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, fileOperationConstants.FileOperationConstants.writingToFileDirective, "写入文件")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, fileOperationConstants.FileOperationConstants.gettingFilePathDirective, "获取文件路径信息")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, fileOperationConstants.FileOperationConstants.waitingForFileDirective, "等待文件")